using System;

namespace SBPweb.Modules.Dependencies
{

	/// <summary>
	/// This excepction thrown when a dependency check failed
	/// </summary>
    public class DependencyException : Exception
    {

        private IVersionDependency pDependency;

        /// <summary>
        /// Initializes a new DependencyException instance
        /// </summary>
        /// <param name="dependency"></param>
		public DependencyException(IVersionDependency dependency)
        {
            pDependency = dependency;
        }

		/// <summary>
		/// Message of the exception
		/// </summary>
        public override string Message
        {
            get
            {
                return string.Format("Dependency not met! \r\n{0}; {1}", pDependency.ToString(), base.Message);
            }
        }

    }
}
